﻿$(document).ready(function () {

    login();
});


function login() {
    $("#login-btn").click(function (event) {
        var Username = $("#input-username").val();
        var Psw = $("#input-password").val();
        $.ajax({
            url: "/Login/Verify",
            type: "post",
            cache: false,
            data: { Username: Username, Psw: Psw },
            dataType: "json",
            success: function (msg) {
                if (msg.Result) {    //登录成功
                    location = "/Home/Index?username=" + Username;  //跳转到主页 
                }
                else {
                    alert(msg.Message);
                }
            }
        });
    });
}